package com.shensi.api.admin.client.integral;

import com.shensi.api.admin.client.fallback.integral.IntegralRuleClientFallBack;
import com.shensi.api.admin.client.fallback.monitor.SysLogininforClientFallBack;
import com.shensi.api.admin.domian.integral.dto.IntegralRuleDto;
import com.shensi.common.core.annotation.Log;
import com.shensi.common.core.constant.CloudConstant;
import com.shensi.common.core.domain.AjaxResult;
import com.shensi.common.core.domain.model.LoginUser;
import com.shensi.common.core.enums.BusinessType;
import com.shensi.common.core.page.TableDataInfo;
import com.shensi.common.core.utils.SecurityUtils;
import com.shensi.common.core.utils.poi.ExcelUtil;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;


/**
 * @author mao
 */
@FeignClient(
        value = CloudConstant.ADMIN_SERVER,
        fallbackFactory = IntegralRuleClientFallBack.class)
@Component
public interface IntegralRuleClient {

    /**
     * 查询积分规则列表
     */
    @GetMapping("/integral/rule/list")
    public TableDataInfo list(@SpringQueryMap IntegralRuleDto integralRule);

    /**
     * 查询积分规则明细
     * @param integralRule
     * @return
     */
    @GetMapping("/integral/rule/listRuleInfo")
    public TableDataInfo listRuleInfo(@SpringQueryMap IntegralRuleDto integralRule);

    @GetMapping("/integral/rule/listRuleOne")
    public AjaxResult listRuleOne(@SpringQueryMap IntegralRuleDto integralRule);
    /**
     * 导出积分规则列表
     */
    @GetMapping("/integral/rule/export")
    public AjaxResult export(@SpringQueryMap IntegralRuleDto integralRule);

    /**
     * 获取积分规则详细信息
     */
    @GetMapping(value = "/integral/rule/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id);

    /**
     * 新增积分规则
     */
    @PostMapping("/integral/rule")
    public AjaxResult add(@RequestBody IntegralRuleDto integralRule);

    /**
     * 修改积分规则
     */
    @PutMapping("/integral/rule")
    public AjaxResult edit(@RequestBody IntegralRuleDto integralRule);

    /**
     * 删除积分规则
     */
    @DeleteMapping("/integral/rule/{ids}")
    public AjaxResult remove(@PathVariable("ids") Long[] ids);
}
